<template>
    <view class="container">
        <view class="cd-bg">
            <!-- 基本信息 -->
            <view class="cd-title">
                <uni-row>
                    <uni-col :span="20">
                        <view class="param">基本信息</view>
                    </uni-col>

                </uni-row>
            </view>
            <view class="cd-body">
                <view class="param">
                    <b>会议主题：</b>
                    {{ detail.meetingTheme }}
                </view>
                <view class="param">
                    <b>发起人：</b>
                    {{ detail.createBy }}
                </view>
                <view class="param">
                    <b>发起时间：</b>
                    {{ getFormatedTimeStr(detail.createTime) }}
                </view>
            </view>

            <!-- 特殊参数 -->
            <view class="cd-line">
                <view class="param">详细信息</view>
            </view>
            <view class="cd-body">
                <view class="param">
                    <b>会议时间：</b>
                    {{ getFormatedTimeStr1(detail.meetingTime) }}
                </view>
                <view class="param">
                    <b>会议地点：</b>
                    {{ detail.meetingPlace }}
                </view>
                <view class="param">
                    <b>会议交办事项：</b>
                    {{ detail.meetingMatter }}
                </view>
                <view class="param">
                    <b>落实情况：</b>
                    {{ detail.meetingWorkable }}
                </view>
            </view>

            <!-- 相关附件 -->
            <view class="cd-line">
                <view class="param">
                    <b>会议纪要</b>
                </view>
            </view>
            <view class="cd-body">
                <!-- 附件 -->
                <view class="param">
                    <b>会议纪要附件：</b>
                </view>
                <view v-for="(it, idx) in detail.url" :key="idx">
                    <view @click="prevFileClick(it)" class="file_list_item">
                        <view>
                            <i class="iconfont icon-24gf-folderOpen" style="color: #3c95ff"></i>
                            {{ it.name }}
                        </view>
                    </view>
                </view>
            </view>
        </view>
    </view>
</template>
    
<script>
import { websock } from "../../net/websock";
import {
    prevFile // 预览普通文件
} from "../../utils/preview.js";
import { gethuiyifankuiList } from "../../net/huiyifankui";
import moment from "moment";
export default {
    data() {
        return {
            nameList: [],
            id: 0,
            taskid: 0,
            see: 0,
            itemsd: "",
            itemssd: "",
            approval: [],
            contents: {},
            taskInfo: {},
            detail: {},
            userInfo: {},
            approvalProcessDataBeanMaps: {}
        };
    },
    async onReady() {
        try {
            this.userInfo = await websock.getUserInfo();
        } catch (e) {
            uni.showToast({
                title: e.message
            });
        }
    },

    async onLoad(params) {
        this.getInfo(JSON.parse(params.content))
    },
    methods: {
        prevFileClick(item) {
            prevFile(item);
        },
        async getInfo(e) {
            const tbMeetingFeedbackNotes = {
                id: e,
            };
            const res = await gethuiyifankuiList(tbMeetingFeedbackNotes);
            console.log(res.data[0]);
            this.detail = res.data[0];
            this.detail.meetingTheme = res.data[0].meetingTheme; //类型
            this.detail.createBy = res.data[0].createBy; //申请人
            this.detail.createTime = res.data[0].createTime;
            this.detail.meetingTime = res.data[0].meetingTime;
            this.detail.meetingPlace = res.data[0].meetingPlace;
            this.detail.meetingMatter = res.data[0].meetingMatter;
            this.detail.meetingWorkable = res.data[0].meetingWorkable
            this.detail.url = JSON.parse(res.data[0].meetingUrl); //附件
        },
        // 获取格式化时间字符串
        getFormatedTimeStr(stamp, str = "YYYY-MM-DD HH:mm:ss") {
            return moment(stamp).format(str);
        },
        getFormatedTimeStr1(stamp, str = "YYYY-MM-DD HH:mm") {
            return moment(stamp).format(str);
        },
    }
};
</script>
    
<style>
@import url("../common/detail.css");
</style>
    